% MOVAVGECG     Causal Moving average calculation of ECG heartrate
%               parameters
%
% Input:    Real-time heartrate
% Output:   Filtered/Smoothed real-time heartrate
%
% See also:     tsmovavg
% Modified at   27th Oct 2010
% Copyright:    Group 8
%------------------------------------------------------------------------
function movavgecg = movavgecg(realHR)
% Setting simple moving average filter
% lag = 7
movavgecg_pre = tsmovavg(realHR,'s',7);
% Return variables
movavgecg = movavgecg_pre(7:length(movavgecg_pre));

return
